<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLogVipRemainsTable extends Migration
{
    /**
     * Run the migrations.
     * vip用户留存统计
     */
    public function up()
    {
        Schema::create('log_vip_remains', function (Blueprint $table) {
            $table->increments('id');
            $table->date('date_time')->comment('日期');
            $table->tinyInteger('type')->comment('类型:1全服,2渠道,3区服');
            $table->integer('server_id')->default(0)->comment('区服ID');
            $table->integer('channel_id')->default(0)->comment('渠道ID');
            $table->integer('new_pay_users')->default(0)->comment('新增付费用户');
            $table->integer('two_rate')->default(0)->comment('次日留存');
            $table->integer('three_rate')->default(0)->comment('三日留存');
            $table->integer('four_rate')->default(0)->comment('四日留存');
            $table->integer('five_rate')->default(0)->comment('五日留存');
            $table->integer('six_rate')->default(0)->comment('六日留存');
            $table->integer('seven_rate')->default(0)->comment('七日留存');
            $table->integer('fifteen_rate')->default(0)->comment('十五日留存');
            $table->integer('thirty_rate')->default(0)->comment('三十日留存');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('log_vip_remains');
    }
}
